package com.leo.entity;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.entity.EntityFactory;
import com.almasb.fxgl.entity.SpawnData;
import com.almasb.fxgl.entity.Spawns;
import com.leo.component.CacheComponent;

/**
 * @Author: wangss
 * @CreateTime: 2023-06-17  22:06
 * @Description: TODO
 */
public class CacheEntityFactory implements EntityFactory {

    @Spawns("rect")
    public Entity createRect(SpawnData spawnData) {
        return FXGL.entityBuilder(spawnData)
                .with(new CacheComponent())
                .build();
    }
}
